/*
 * $Id$
 *
 * Copyright ( c ) 2014 XuNuo Corporation. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of XuNuo
 * Corporation ("Confidential Information").  You shall not disclose such
 * Confidential Information and shall use it only in accordance with the terms
 * of the license agreement you entered into with XuNuo Corporation or a XuNuo
 * authorized reseller (the "License Agreement"). XuNuo may make changes to the
 * Confidential Information from time to time. Such Confidential Information may
 * contain errors.
 *
 * EXCEPT AS EXPLICITLY SET FORTH IN THE LICENSE AGREEMENT, XuNuo DISCLAIMS ALL
 * WARRANTIES, COVENANTS, REPRESENTATIONS, INDEMNITIES, AND GUARANTEES WITH
 * RESPECT TO SOFTWARE AND DOCUMENTATION, WHETHER EXPRESS OR IMPLIED, WRITTEN OR
 * ORAL, STATUTORY OR OTHERWISE INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A
 * PARTICULAR PURPOSE. XuNuo DOES NOT WARRANT THAT END USER'S USE OF THE
 * SOFTWARE WILL BE UNINTERRUPTED, ERROR FREE OR SECURE.
 *
 * XuNuo SHALL NOT BE LIABLE TO END USER, OR ANY OTHER PERSON, CORPORATION OR
 * ENTITY FOR INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL
 * DAMAGES, OR DAMAGES FOR LOSS OF PROFITS, REVENUE, DATA OR USE, WHETHER IN AN
 * ACTION IN CONTRACT, TORT OR OTHERWISE, EVEN IF XuNuo HAS BEEN ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGES. XuNuo' TOTAL LIABILITY TO END USER SHALL NOT
 * EXCEED THE AMOUNTS PAID FOR THE XuNuo SOFTWARE BY END USER DURING THE PRIOR
 * TWELVE (12) MONTHS FROM THE DATE IN WHICH THE CLAIM AROSE.  BECAUSE SOME
 * STATES OR JURISDICTIONS DO NOT ALLOW LIMITATION OR EXCLUSION OF CONSEQUENTIAL
 * OR INCIDENTAL DAMAGES, THE ABOVE LIMITATION MAY NOT APPLY TO END USER.
 *
 * Copyright version 2.0
 */
package com.th.supcom.pds.phamapply.client.widget.phamapplydetail;

import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
import com.extjs.gxt.ui.client.widget.form.DateField;
import com.extjs.gxt.ui.client.widget.form.DateTimePropertyEditor;
import com.extjs.gxt.ui.client.widget.form.FormPanel;
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
import com.th.supcom.pds.common.client.model.CodeConstants;
import com.th.supcom.pds.phamapply.client.model.InpPhamApplyDetailModel;

/**
 * 药品请领界面中的摆药条件form
 * 
 * @author 杨冲
 */
public class PhamApplyCancelConditionForm extends FormPanel
{
    /** 摆药状态. */
    private ComboBox<InpPhamApplyDetailModel> m_dispenseIndicator;
    /** 开始时间框 */
    private DateField m_beginDate;
    /** 结束时间框 */
    private DateField m_endDate;
    /** 查询按钮. */
    private Button m_queryBtn;
    /**
     * 构造函数
     */
    public PhamApplyCancelConditionForm ()
    {
        setFrame (true);
        initUI ();
    }
    /**
     * 初始化UI
     */
    public void initUI ()
    {
        
        setHeaderVisible (false);
        setBodyBorder (false);
        setBorders (false);
        this.setHeight (70);
        FormLayout formLayout = new FormLayout ();
        formLayout.setLabelWidth (60);
        formLayout.setDefaultWidth (100);
        setLayout (formLayout);
        setButtonAlign (HorizontalAlignment.CENTER);
        initFields ();
    }

    /**
     * 初始化组件
     */
    public void initFields ()
    {
        m_dispenseIndicator=new  ComboBox<InpPhamApplyDetailModel>();
        m_dispenseIndicator.setTriggerAction (TriggerAction.ALL);
        m_dispenseIndicator.setDisplayField ("dispenseIndicatorName");
        ListStore <InpPhamApplyDetailModel>listStore=new ListStore <InpPhamApplyDetailModel> ();
        InpPhamApplyDetailModel model=new InpPhamApplyDetailModel();
        model.setDispenseIndicator ("B");
        model.setDispenseIndicatorName ("已分拣");
        InpPhamApplyDetailModel model2=new InpPhamApplyDetailModel();
        model2.setDispenseIndicator ("C");
        model2.setDispenseIndicatorName ("已发药");
        listStore.add (model);
        listStore.add (model2);
        m_dispenseIndicator.setStore (listStore);
        m_dispenseIndicator.setFieldLabel ("摆药状态");
        m_beginDate=new DateField ();
        m_beginDate.setPropertyEditor (new DateTimePropertyEditor (CodeConstants.DATE_FORMAT_YYYY_MM_DD));
        m_beginDate.setFieldLabel ("开始时间");
        m_beginDate.setEditable (false);
        m_endDate=new DateField ();
        m_endDate.setPropertyEditor (new DateTimePropertyEditor (CodeConstants.DATE_FORMAT_YYYY_MM_DD));
        m_endDate.setFieldLabel ("截止时间");
        m_endDate.setEditable (false);
        m_queryBtn=new Button ("查询");
        
        //add (m_dispenseIndicator);
        add (m_beginDate);
        add (m_endDate);
        addButton (m_queryBtn);
    }
    public ComboBox <InpPhamApplyDetailModel> getDispenseIndicator ()
    {
    
        return m_dispenseIndicator;
    }
    public DateField getBeginDate ()
    {
    
        return m_beginDate;
    }
    public DateField getEndDate ()
    {
    
        return m_endDate;
    }
    public Button getQueryBtn ()
    {
    
        return m_queryBtn;
    }
    
}
